package net.lzzy.chapter506;

import org.omg.PortableServer.THREAD_POLICY_ID;

import java.util.ArrayList;

public class Greetings_Student {
    public static void main(String[] args) {
        Runnable print1 = new Greetings("你好",50);
        Runnable print2 = new Greetings("很高兴认识你",50);

        Student stu2 = new Student("2","3",16);
        Student stu3 = new Student("3","4",17);
        Student stu4 = new Student("4","5",18);

        Runnable bye1 = new Goodbye("再见",50);
        Runnable bye2 = new Goodbye("再见",50);
        Runnable bye3 = new Goodbye("再见",50);

        Student[] zhi = new Student[]{stu2,stu3,stu4};

        PrintStudent<Student> ss = new PrintStudent<Student>(zhi);

        Thread thread1 = new Thread(print1);
        Thread thread2 = new Thread(print2);
        Thread thread3 = new Thread(ss);
        Thread thread4 = new Thread(bye1);
        Thread thread5 = new Thread(bye2);
        Thread thread6 = new Thread(bye3);

        thread1.start();
        thread2.start();
        thread3.start();
        thread4.start();
        thread5.start();
        thread6.start();

    }
}
